package com.qd.common.panda.domain.entity.carpark;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.annotation.Latitude;
import com.cdqidi.valid.annotation.Longitude;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * 停车场位置信息
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
@JsonIgnoreProperties(value = {"pageNumber", "pageSize", "beginTime", "endTime", "sqlParams", "sysParams", "asc", "desc", "orgIds", "adCode", "location"}, allowSetters = true)
public class CarParkLocation extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "停车场位置信息";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "停车场标识"})
    @NotBlank(message = "停车场标识不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "停车场标识长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    @JsonProperty("pId")
    private String pId;
    /**
     * 地址
     */
    @ExcelProperty(value = {EXCEL_TITLE, "地址"})
    @NotBlank(message = "地址不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "地址长度不能超过{max}位", groups = DefaultGroup.class)
    private String address;
    /**
     * 纬度
     */
    @ExcelProperty(value = {EXCEL_TITLE, "纬度"})
    @NotNull(message = "纬度不能为空", groups = DefaultGroup.class)
    @Latitude(message = "请输入正确的纬度值", groups = DefaultGroup.class)
    private BigDecimal lat;
    /**
     * 经度
     */
    @ExcelProperty(value = {EXCEL_TITLE, "经度"})
    @NotNull(message = "经度不能为空", groups = DefaultGroup.class)
    @Longitude(message = "请输入正确的经度值",groups = DefaultGroup.class)
    private BigDecimal lng;
    /**
     * 行政区划代码:行政区划代码
     */
    @ExcelProperty(value = {EXCEL_TITLE, "行政区划代码"})
    @Size(max = 6, message = "行政区划代码长度不能超过{max}位", groups = DefaultGroup.class)
    private String adCode;
    /**
     * 位置类型 0腾讯 1百度
     */
    @ExcelProperty(value = {EXCEL_TITLE, "位置类型"})
    @NotNull(message = "位置类型不能为空", groups = DefaultGroup.class)
    private Integer locationType;
    /**
     * 位置类型显示
     */
    private String locationTypeDisplay;
    /**
     * 所在地区编码
     */
    @Size(max = 100, message = "所在地区编码长度不能超过{max}位", groups = DefaultGroup.class)
    private String region;
    /**
     * 所在地区名称
     */
    @Size(max = 200, message = "所在地区名称长度不能超过{max}位", groups = DefaultGroup.class)
    private String regionName;

    private String location;

    @Override
    public void freeData() {
        this.pId = null;
        this.address = null;
        this.lat = null;
        this.lng = null;
        this.adCode = null;
        this.locationType = null;
        this.locationTypeDisplay = null;
        this.region = null;
        this.regionName = null;
        super.freeData();
    }
}
